package com.example.t410.dao;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;

/***
 *性格测试题目类
 */
@Document("mbtiTopic") //表名称
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Topic implements Serializable {


    @Id  //主键
    private String id;

    @Field
    private String name;

    @Field
    private String optionA;

    @Field
    private String optionB;


    @Indexed(unique = true) //唯一索引
    @Field("sequence_number")//对应mongo中的字段，如果不对应，需要进行标注
    private Integer sequenceNumber;

    @Field
    private String valA;

    @Field
    private String valB;
}
